package com.xpsoft.oa.dao.produce.impl;


import java.util.List;

import org.hibernate.Query;

import com.xpsoft.core.dao.impl.BaseDaoImpl;
import com.xpsoft.oa.dao.produce.ProjectAttendInfoDao;
import com.xpsoft.oa.model.produce.ProjectAttendInfo;

public class ProjectAttendInfoDaoImpl extends BaseDaoImpl<ProjectAttendInfo> implements ProjectAttendInfoDao{

	public ProjectAttendInfoDaoImpl() {
		super(ProjectAttendInfo.class);
	}

	@Override
	public void deleteProjectAttendInfos(Long attendId, List<Long> idList) {
		// TODO Auto-generated method stub
		String hql = "delete from ProjectAttendInfo where id not in (:ids) and projectAttend.id=:attendId";
		Query query =  getSession().createQuery(hql);
		query.setParameterList("ids", idList).setParameter("attendId", attendId);
		query.executeUpdate();
	}

}